<template>
	<view class="code-box">
		<mumu-one-code class="sectionview flex-center"
			@success="handleSuccess" 
			@error="handleError"
			:definition="true"
			:readers='["code_128_reader"]'
		></mumu-one-code>
	</view>
</template>

<script setup>
	import {
		onShow
	} from "@dcloudio/uni-app";
	import MumuOneCode from '@/uni_modules/mumu-oneCode/components/mumu-oneCode/mumu-oneCode.vue';
	
	const handleSuccess = (code) => {
		uni.$emit('mumuCode', {
			code
		})
		uni.navigateBack({
			delta: 1,
			success: (event) => {
		
			}
		});
	}
	const handleError = (err) => {
		uni.navigateBack();
	}
	
	onShow(()=>{
			
	})
</script>

<style lang="scss">
	.code-box{
		width: 100%;
		height: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>
